Replace the user rename log display for non-existent userpages with a hook (followup...
authorAlex Z <mrzman@users.mediawiki.org>
Mon, 14 Sep 2009 18:10:13 +0000 (18:10 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Mon, 14 Sep 2009 18:10:13 +0000 (18:10 +0000)
Update for Renameuser extension to follow.

Also make docs for LogEventsList::showLogExtract() actually useful

RELEASE-NOTES
docs/hooks.txt
includes/Article.php
includes/LogEventsList.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 384c460..7461737 100644 (file)
@@ -222,8 +222,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   excerpt from the block log.
 * (bug 19646) New hook: ImgAuthBeforeStream for tests and functionality before
   file is streamed to user, but only when using img_auth
-* Note on non-existing user and user talk pages if user does not exist and show
-  renameuser log if the user has been renamed
+* Note on non-existing user and user talk pages if user does not exist
+* New hook ShowMissingArticle so extensions can modify the output for 
+  non-existent pages.
 
 === Bug fixes in 1.16 ===
 
index eae8691..11a0e50 100644 (file)
@@ -1231,6 +1231,9 @@ $term : Search term string
 
 'SetupAfterCache': Called in Setup.php, after cache objects are set
 
+'ShowMissingArticle': Called when generating the output for a non-existent page
+$article: The article object corresponding to the page
+
 'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
 $text: Text being shown
 $title: Title of the custom script/stylesheet page
index 5999ea4..cb32a14 100644 (file)
@@ -1201,20 +1201,17 @@ class Article {
        public function showMissingArticle() {
                global $wgOut, $wgRequest, $wgUser;
 
-               # Show info in user (talk) namespace. Does the user exist and if not, has he been renamed.
+               # Show info in user (talk) namespace. Does the user exist?
                if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
                        $id = User::idFromName( $this->mTitle->getBaseText() );
                        $ip = User::isIP( $this->mTitle->getBaseText() );
                        if ( $id == 0 && !$ip ) { # User does not exist
                                $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">$1</div>',
                                        array( 'userpage-userdoesnotexist-view', $this->mTitle->getBaseText() ) );
-
-                               # Show rename log because user does not exist. 
-                               $parent = $this->mTitle->getNsText() . ":" . $this->mTitle->getBaseText();
-                               LogEventsList::showLogExtract( $wgOut, 'renameuser', $parent, '', 10, array(), false, 'renamed-notice' );
                        }
 
                }
+               wfRunHooks( 'ShowMissingArticle', array( $this ) );
                # Show delete and move logs
                LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), 
                        $this->mTitle->getPrefixedText(), '', 10, array( "log_action != 'revision'" ), false, 'moveddeleted-notice');
index 7c209f9..04063a9 100644 (file)
@@ -569,10 +569,10 @@ class LogEventsList {
         * Show log extract. Either with text and a box (set $msgKey) or without (don't set $msgKey)
         * @param $out OutputPage or String-by-reference
         * @param $types String or Array
-        * @param $page String
-        * @param $user String
+        * @param $page String The page title to show log entries for
+        * @param $user String The user who made the log entries
         * @param $lim Integer Limit of items to show, default is 50
-        * @param $conds Array
+        * @param $conds Array Extra conditions for the query
         * @param $showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
         *              if set to true (default), "No matching items in log" is displayed if loglist is empty
         * @param $msgKey String if you want a nice box with a message, set this to the key of the message
@@ -663,13 +663,13 @@ class LogPager extends ReverseChronologicalPager {
        /**
         * constructor
         * @param $list LogEventsList
-        * @param $types String or Array
-        * @param $user String
-        * @param $title String
-        * @param $pattern String
-        * @param $conds Array
-        * @param $year Integer
-        * @param $month Integer
+        * @param $types String or Array log types to show
+        * @param $user String The user who made the log entries
+        * @param $title String The page title the log entries are for
+        * @param $pattern String Do a prefix search rather than an exact title match
+        * @param $conds Array Extra conditions for the query
+        * @param $year Integer The year to start from
+        * @param $month Integer The month to start from
         */
        public function __construct( $list, $types = array(), $user = '', $title = '', $pattern = '',
                $conds = array(), $year = false, $month = false, $tagFilter = '' ) 
index a898ba3..b4749ef 100644 (file)
@@ -1342,8 +1342,6 @@ You should consider whether it is appropriate to continue editing this page.
 The deletion and move log for this page are provided here for convenience:",
 'moveddeleted-notice'              => 'This page has been deleted.
 The deletion and move log for the page are provided below for reference.',
-'renamed-notice'                   => 'This user has been renamed.
-The rename log is provided below for reference.',
 'log-fulllog'                      => 'View full log',
 'edit-hook-aborted'                => 'Edit aborted by hook.
 It gave no explanation.',
index 43bd0c0..d1ef3c3 100644 (file)
@@ -589,7 +589,6 @@ $wgMessageStructure = array(
                'permissionserrorstext-withaction',
                'recreate-moveddeleted-warn',
                'moveddeleted-notice',
-               'renamed-notice',
                'log-fulllog',
                'edit-hook-aborted',
                'edit-gone-missing',